// 入口文件 负责整合路由规则和展示组件
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' // 导入elm样式
import './plugins/element.js' // 导入elm 按需导入的代码
import './assets/css/global.css'
import './assets/fonts/iconfont.css'
import axios from 'axios'
// import vueTable from 'vue-table-with-tree-grid'

Vue.prototype.$http = axios // 将axios对象挂载到全局vue 实例身上
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/' // 基础url请求地址
axios.interceptors.request.use(config => { // 为请求头对象，添加token验证的Authorization字段
  config.headers.Authorization = window.localStorage.getItem('token')
  return config
})

Vue.use(ElementUI)// 添加饿了么ui
Vue.config.productionTip = false
// Vue.component(vueTable, vueTable)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
